package com.lht.admin.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 借款数据信息表实体
 *
 * @author ZhengZhanWu
 * @date 2019-12-29 13:30:03
 */
@Data
@NoArgsConstructor
@TableName("lst_apply_info")
public class ApplyInfoEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Getter
    @AllArgsConstructor
    public enum ApplyTypeEnum {

        /**
         * 个人
         */
        PERSON("1", "个人"),

        /**
         * 公司
         */
        COMPANY("2", "公司");

        private final String value;
        private final String desc;
    }

    /**
     * 主键id
     */
    @TableId
    private Long id;
    /**
     * 创建时间
     */
    private Date createAt;
    /**
     * 更新时间
     */
    private Date updateAt;
    /**
     * 是否删除   0:未删除(默认)   1:删除
     */
    private String isDelete;
    /**
     * 申请编号
     */
    private String applyNo;
    /**
     * 推销员用户id
     */
    private Long promoUserId;
    /**
     * 申请类型   1:个人   2:企业
     */
    private String applyType;
    /**
     * 用途id
     */
    private Long loanPurposeId;
    /**
     * 其他用途
     */
    private String loanPurposeOther;

    /**
     * 经纪人
     */
    @TableField(exist = false)
    private SysUserEntity promoUser;

    /**
     * 公司信息
     */
    @TableField(exist = false)
    private CompanyInfoEntity companyInfo;

    /**
     * 个人信息
     */
    @TableField(exist = false)
    private PersonInfoEntity personInfo;

    /**
     * 单位信息
     */
    @TableField(exist = false)
    private WorkCompanyInfoEntity workCompanyInfo;

    /**
     * 房产信息
     */
    @TableField(exist = false)
    private AssetsHouseInfoEntity assetsHouseInfo;

    /**
     * 车产信息
     */
    @TableField(exist = false)
    private AssetsCarInfoEntity assetsCarInfo;

    /**
     * 保险,信用卡信息
     */
    @TableField(exist = false)
    private AssetsCreditInfoEntity assetsCreditInfo;

    /**
     * 贷款信息
     */
    @TableField(exist = false)
    private List<LoanInfoEntity> loanInfoList;

    /**
     * 税务信息
     */
    @TableField(exist = false)
    private List<TaxInfoEntity> taxInfoList;


    public static final String ID = "id";
    public static final String CREATE_AT = "create_at";
    public static final String IS_DELETE = "is_delete";
    public static final String UPDATE_AT = "update_at";
    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String APPLY_TYPE = "apply_type";
    public static final String LOAN_PURPOSE_ID = "loan_purpose_id";
    public static final String LOAN_PURPOSE_OTHER = "loan_purpose_other";

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
